import request from '/@/utils/request';

// 查询商家的自有会员列表
export function listVip(query?: Object) {
  return request({
    url: '/module/mer/self/vip/list',
    method: 'get',
    params: query
  })
}

export function listVipMoney(query?: Object) {
  return request({
    url: '/module/mer/self/vip/list/money',
    method: 'get',
    params: query
  })
}

// 查询商家的自有会员详细
export function getVip(id?: number) {
  return request({
    url: '/module/mer/self/vip/' + id,
    method: 'get'
  })
}

// 新增商家的自有会员
export function addVip(data?: Object) {
  return request({
    url: '/module/mer/self/vip',
    method: 'post',
    data: data
  })
}

// 新增商家的自有会员
export function addUnVip(data?: Object) {
  return request({
    url: '/module/mer/self/vip/un',
    method: 'post',
    data: data
  })
}

// 修改商家的自有会员
export function updateVip(data?: Object) {
  return request({
    url: '/module/mer/self/vip',
    method: 'put',
    data: data
  })
}

// 修改商家的自有会员
export function recharge(data?: Object) {
  return request({
    url: '/module/mer/self/vip/recharge',
    method: 'put',
    data: data
  })
}



// 删除商家的自有会员
export function delVip(id?: number) {
  return request({
    url: '/module/mer/self/vip/' + id,
    method: 'delete'
  })
}

// 导出商家的自有会员
export function exportVip(query?: Object) {
  return request({
    url: '/module/mer/self/vip/export',
    method: 'get',
    params: query
  })
}

export function resetQrCode(data?: Object) {
  return request({
    url: '/module/mer/self/vip/resetQrCode',
    method: 'post',
    data: data
  })
}
